<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class AdminValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'account' => 'require|unique:admin|length:5,25',
        'password' => 'require|length:6,10',
        'role_id' => 'require|number',
        'nickname' => 'require|length:2,25',
        'email'    => 'require|email',
        'status'   => 'require|in:0,1'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [];

    protected $scene = [
        'login' => ['account','password']
    ];
}
